package com.dawnling.androidutils.ui;

import android.os.Bundle;

import androidx.appcompat.app.AppCompatActivity;

import com.dawnling.androidutils.R;
import com.dawnling.androidutils.view.CustomProgress;
import com.dawnling.androidutils.view.ProgressView;
import com.dawnling.androidutils.view.KeytopProgressView;

public class UtilesActivity extends AppCompatActivity {

    private CustomProgress customProgress;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_utiles);

        //科拓进度条
        KeytopProgressView view1 = findViewById(R.id.view);
        view1.setMaxCount(100);
        view1.setTempHeight(45);
        view1.setCurrentCount(50);
        //比特币进度条
        ProgressView view2 = findViewById(R.id.view1);
        view2.setMaxCount(100);//设置最大刻度
        view2.setHeight(60);
        view2.setTempHeight(30);//设置进度条高度
        view2.setCurrentCount(40);//设置当前刻度
        //传入渐变颜色
        view2.setSetionColor(new int[]{getResources().getColor(R.color.colorBlue), getResources().getColor(R.color.colorBlueLight)});

        //blog: https://blog.csdn.net/chenguang79/article/details/52064217
        initControls();
    }

    /**
     * 初始化控件
     */
    private void initControls() {
        customProgress = (CustomProgress)findViewById(R.id.myPre);
        customProgress.setINum(20);
        customProgress.setONum(80);
    }
}
